package com.ele.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ele.pojo.Menu;
import com.ele.pojo.ResponseData;
import com.ele.service.MenuService;
import com.ele.mapper.MenuMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 28444
* @description 针对表【menu】的数据库操作Service实现
* @createDate 2024-04-08 15:00:30
*/
@Service
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu>
    implements MenuService{
    public ResponseData<Menu> getMenuList() {
        LambdaQueryWrapper<Menu> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Menu::getUseable,0);
        List<Menu> list = this.list(wrapper);
        ResponseData<Menu> responseData = new ResponseData<>();
        if (list != null && !list.isEmpty()){
            responseData.setCode(20000);
            responseData.setDatas(list);
        }else{
            responseData.setCode(50000);
            responseData.setMessage("没有查询到数据");
        }
        return responseData;
    }
}




